import request from '@/config/axios'
import type { MemberLevel } from './types'

export const getMemberLevelsListApi = (params: any): Promise<IResponse> => {
  return request.get({ url: '/member-levels', params })
}

export const createMemberLevelsApi = (data: Partial<MemberLevel>): Promise<IResponse> => {
  return request.post({ url: '/member-levels', data })
}

export const updateMemberLevelsApi = (
  id: string,
  data: Partial<MemberLevel>
): Promise<IResponse> => {
  return request.put({ url: `/member-levels/id/${id}`, data })
}

export const getMemberLevelsDetailApi = (id: string): Promise<IResponse<MemberLevel>> => {
  return request.get({ url: `/member-levels/id/${id}` })
}

export const delMemberLevelsListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.delete({ url: `/member-levels/id/${ids[0]}` })
}
